diff options
| author | real-zephex <[email protected]> | 2024-03-15 21:23:45 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-03-15 21:23:45 +0530 |
| commit | aabc2fa63b70079a62cb6ffb47c1542e6c73286d (patch) | |
| tree | fe17c37c518ce0e6688f6b9dae3ba1468d49bcda /src/app/info/[id] | |
| parent | minor fix: changed the website title (diff) | |
| download | dramalama-aabc2fa63b70079a62cb6ffb47c1542e6c73286d.tar.xz dramalama-aabc2fa63b70079a62cb6ffb47c1542e6c73286d.zip | |
features: added anime and pretty much completed it. only search functionality is left to add
Diffstat (limited to 'src/app/info/[id]')
| -rw-r--r-- | src/app/info/[id]/page.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/app/info/[id]/page.js b/src/app/info/[id]/page.js new file mode 100644 index 0000000..43b11ac --- /dev/null +++ b/src/app/info/[id]/page.js @@ -0,0 +1,45 @@ +import "../info.css" +import Image from "next/image"; +import CreateButton from "../buttons"; + +export default async function AnimeInfo({params}) { + let animeID = params.id; + + const info = await getAnimeInfo(animeID); + + return ( + <div className="dramaInfoContainer"> + <div className="dramaInfo"> + {info && ( + <div> + <div className="titleContainer"> + <p>{info.title}</p> + <Image + src={info.image} + width={140} + height={190} + alt="Drama" + /> + </div> + <p className="dramaDescription"> + {info.description} + </p> + </div> + )} + + <div className="buttonContainer"> + {info && info.episodes.map((item, index) => ( + <CreateButton key={index} a={item} /> + ))} + </div> + + </div> + </div> + ) +} + +async function getAnimeInfo(anime_id) { + const res = await fetch("https://anime-sensei-api.vercel.app/anime/gogoanime/info/" + anime_id); + const data = res.json(); + return data; +}
\ No newline at end of file |